﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MxWeiXinPF.Common;
using System.Text;
using MxWeiXinPF.Web.UI;


namespace MxWeiXinPF.Web.weixin.ucard
{
    public partial class userinfo : WeiXinPage
    {
        
        protected int wid = 0;
        
        protected int degreeNum = 0;
        protected int uid = 0;
        protected string uName = "";
        protected string tel = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
          
            wid = MyCommFun.RequestInt("wid");
           
            string thisUrl = MyCommFun.getWebSite() + "/weixin/ucard/ucardTicket.aspx?wid=" + wid ;
            //授权
            BLL.wx_userweixin bll = new BLL.wx_userweixin();
            Model.wx_userweixin uWeiXinModel = bll.GetModel(wid);
            OAuth2BaseProc(uWeiXinModel, "duihuan", thisUrl);
            //授权 end

            if (openid == "" || wid == 0  )
            {
                hidStatus.Value = "-1";
                hidErrInfo.Value = "参数错误";
                return;
            }
           
            bindData();
        }


        private void bindData()
        {
            BLL.wx_ucard_cardinfo cardBll = new BLL.wx_ucard_cardinfo();
            Model.wx_ucard_cardinfo cardinfo = cardBll.GetModelByWid(wid);
            if (cardinfo != null)
            {
                imgTopPic.ImageUrl = cardinfo.perinfoPic;
            }

            BLL.wx_ucard_users userBll = new BLL.wx_ucard_users();
            Model.wx_ucard_users user = userBll.GetUserInfoByWid(openid, wid);

            uName = user.realName;
            tel = user.mobile;



        }
    }
}